package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzSypicMapper;
import com.ruoyi.system.domain.DzSypic;
import com.ruoyi.system.service.IDzSypicService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 商业相册Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-17
 */
@Service
public class DzSypicServiceImpl implements IDzSypicService 
{
    @Autowired
    private DzSypicMapper dzSypicMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询商业相册
     * 
     * @param sxId 商业相册主键
     * @return 商业相册
     */
    @Override
    public DzSypic selectDzSypicBySxId(Long sxId)
    {
        return dzSypicMapper.selectDzSypicBySxId(sxId);
    }

    /**
     * 查询商业相册列表
     * 
     * @param dzSypic 商业相册
     * @return 商业相册
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzSypic> selectDzSypicList(DzSypic dzSypic)
    {

        return dzSypicMapper.selectDzSypicList(dzSypic);
    }

    @Override
    public List<DzSypic> selectDzSypicListWeb(DzSypic dzSypic)
    {
        return dzSypicMapper.selectDzSypicList(dzSypic);
    }

    /**
     * 新增商业相册
     * 
     * @param dzSypic 商业相册
     * @return 结果
     */
    @Override
    public int insertDzSypic(DzSypic dzSypic)
    {
        dzSypic.setCreateTime(DateUtils.getNowDate());
        return dzSypicMapper.insertDzSypic(dzSypic);
    }

    /**
     * 修改商业相册
     * 
     * @param dzSypic 商业相册
     * @return 结果
     */
    @Override
    public int updateDzSypic(DzSypic dzSypic)
    {
        return dzSypicMapper.updateDzSypic(dzSypic);
    }

    /**
     * 批量删除商业相册
     * 
     * @param sxIds 需要删除的商业相册主键
     * @return 结果
     */
    @Override
    public int deleteDzSypicBySxIds(Long[] sxIds)
    {
        return dzSypicMapper.deleteDzSypicBySxIds(sxIds);
    }

    /**
     * 删除商业相册信息
     * 
     * @param sxId 商业相册主键
     * @return 结果
     */
    @Override
    public int deleteDzSypicBySxId(Long sxId)
    {
        return dzSypicMapper.deleteDzSypicBySxId(sxId);
    }
}
